<template>
	<view>
		<HeaderBar title="订单支付" :opacity="opacity" color="#fff" />
		<view class="bg"></view>
		<view class="layout">
			<view class="bg-img">
				<image src="/static/img.png" mode=""></image>
			</view>
			<view class="bg-tx">
				支付成功
				<image src="/static/7.png" mode=""></image>
			</view>
		</view>
		
		<view class="content">
			<view class="header">
				<view class="header-title">下单时间</view>
				<view class="header-time">{{orderInfo.order.created_at || ''}}</view>
				<view class="header-btn" @click="toHistory">
					历史订单
					<image src="/static/4.png" mode=""></image>
				</view>
			</view>
			<view class="content-list">
				<view class="content-list-item">
					<image src="/static/5.png" mode=""></image>
					<view class="content-list-item-r">
						<view class="content-list-item-r-title">订单编号</view>
						<view class="content-list-item-r-subTitle">
							{{orderInfo.order.order_no || ''}}
						</view>
					</view>
				</view>
				<view class="content-list-item">
					<image src="/static/6.png" mode=""></image>
					<view class="content-list-item-r">
						<view class="content-list-item-r-title">下单时间</view>
						<view class="content-list-item-r-subTitle">
							{{orderInfo.order.updated_at || ''}}
						</view>
					</view>
				</view>
				<view class="content-list-item">
					<image src="/static/3.png" mode=""></image>
					<view class="content-list-item-r">
						<view class="content-list-item-r-title">支付方式</view>
						<view class="content-list-item-r-subTitle">
							#微信零钱
						</view>
					</view>
				</view>
				<view class="btns" @click="toDetail(orderInfo.order.qr_code_img)">
					订单核销
				</view>
			</view>
		</view>
		
	</view>
</template>

<script>
	import HeaderBar from "@/components/header/header.vue"
	export default {
		components: {
			HeaderBar
		},
		data() {
			return {
				opacity: 0,
				orderInfo: ''
			};
		},
		onLoad() {
			this.orderInfo = uni.getStorageSync('orderInfo')
		},
		methods:{
			toDetail(url) {
				uni.setStorageSync('qrcode', url)
				uni.navigateTo({
					url:'/pages/order_write_off/order_write_off'
				})
			},
			toHistory() {
				uni.navigateTo({
					url:'/pages/order-history/order-history'
				})
			}
		}
	}
</script>

<style lang="scss">
	.bg {
		width: 100%;
		height: 700rpx;
		position: absolute;
		top: 0;
		left: 0;
		z-index: -1;
		background: #0065FF;
	}
	.layout {
		width: 100%;
		height: 400rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		flex-direction: column;
		margin-bottom: 40rpx;
		.bg-img {
			width: 512rpx;
			height: 230.4rpx;
			image {
				width: 100%;
				height: 100%;
				margin-bottom: 24rpx;
			}
		}
		.bg-tx {
			color: #ffffff;
			 text-align: right;
			 font-family: "PingFang SC";
			 font-size: 48rpx;
			 font-style: normal;
			 font-weight: 400;
			 
			 display: flex;
			 align-items: center;
			 justify-content: center;
			 image {
				 width: 40rpx;
				 height: 40rpx;
				 margin-left: 20rpx;
			 }
		}
	}
	.qrCode {
		width: 100vw;
		display: flex;
		align-items: center;
		justify-content: center;
		flex-direction: column;
		padding: 100rpx 0;
		.qrCode-img {
			width: 400rpx;
			height: 400rpx;
			margin-bottom: 90rpx;
		}
		.qrCode-title {
			 color: #000000;
			 text-align: center;
			 font-family: "PingFang SC";
			 font-size: 28rpx;
			 font-style: normal;
			 font-weight: 500;
			 margin-bottom: 116rpx;
		}
		.qrCode-btn {
			width: 364rpx;
			height: 90rpx;
			flex-shrink: 0;
			fill: #0065FF;
			display: flex;
			align-items: center;
			justify-content: center;
			color: #0065FF;
			 font-family: "PingFang SC";
			 font-size: 36rpx;
			 font-style: normal;
			 font-weight: 500;
			 background: #E6F0FF;
			 border-radius: 46rpx;
		}
	}
	.content {
		width: 100%;
		position: relative;
		background: white;
		box-sizing: border-box;
		padding: 0 40rpx;
		margin-bottom: 58rpx;

		.content-title {
			color: #112950;
			font-family: "PingFang SC";
			font-size: 48rpx;
			font-style: normal;
			font-weight: 400;
			margin-bottom: 4rpx;
		}

		.content-subTitle {
			color: #b2bac6;
			font-family: "PingFang SC";
			font-size: 30rpx;
			font-style: normal;
			font-weight: 400;
		}
		.header {
			width: 100%;
			display: flex;
			align-items: center;
			justify-content: center;
			flex-direction: column;
			padding: 40rpx 0;
			.header-title {
				color: #8e9aab;
				 text-align: center;
				 font-family: "PingFang SC";
				 font-size: 28rpx;
				 font-style: normal;
				 font-weight: 400;
				 margin-bottom: 10rpx;
			}
			.header-time {
				color: #112950;
				 text-align: center;
				 font-family: "PingFang SC";
				 font-size: 34rpx;
				 font-style: normal;
				 font-weight: 400;
				 margin-bottom: 40rpx;
			}
			.header-btn {
				width: 654rpx;
				height: 108rpx;
				flex-shrink: 0;
				border-radius: 24rpx;
				border: 2rpx solid #E5E5E5;
				display: flex;
				align-items: center;
				justify-content: center;
				color: #0065ff;
				 font-family: "PingFang SC";
				 font-size: 34rpx;
				 font-style: normal;
				 font-weight: 400;
				 image {
					 width: 32.67rpx;
					 height: 32rpx;
					 margin-left: 20rpx;
				 }
			}
		}
		.content-list {
			width: 100%;
			border-top: 1rpx solid #E5E5E5;
			box-sizing: border-box;
			padding: 60rpx 40rpx;
			.content-list-item {
				width: 100%;
				display: flex;
				margin-bottom: 60rpx;
				&>image {
					width: 32rpx;
					height: 32rpx;
					margin-right: 20rpx;
				}
				.content-list-item-r {
					flex: 1;
					min-width: 0;
					.content-list-item-r-title {
						 color: #112950;
						 font-family: "PingFang SC";
						 font-size: 28rpx;
						 font-style: normal;
						 font-weight: 400;
						 margin-bottom: 10rpx;
					}
					.content-list-item-r-subTitle {
						color: #0f62f9;
						 font-family: "PingFang SC";
						 font-size: 34rpx;
						 font-style: normal;
						 font-weight: 600;
					}
				}
			}
		}
	}

	.content::before {
		content: "";
		width: 100%;
		height: 45rpx;
		background: white;
		border-top-right-radius: 50rpx;
		position: absolute;
		top: -42rpx;
		left: 0;
	}
	.list {
		width: 100%;
		box-sizing: border-box;
		padding: 0 40rpx;
		.list-table {
			height: 64rpx;
			flex-shrink: 0;
			border-radius: 16rpx;
			background: #F4F9FD;
			display: flex;
			margin-bottom: 18rpx;
			.list-table-item {
				flex: 1;
				min-width: 0;
				display: flex;
				align-items: center;
				justify-content: center;
				 color: #3f3f44;
				 font-family: "PingFang SC";
				 font-size: 24rpx;
				 font-style: normal;
				 font-weight: 400;
			}
		}
		.list-title {
			width: 100%;
			display: flex;
			align-items: center;
			margin-bottom: 24rpx;
			image {
				width: 48rpx;
				height: 48rpx;
				margin-right: 4rpx;
			}
			 color: #3f8cff;
			 font-family: "PingFang SC";
			 font-size: 30rpx;
			 font-style: normal;
			 font-weight: 400;
		}
		.list-item {
			width: 100%;
			display: flex;
			align-items: center;
			margin-bottom: 40rpx;
			box-sizing: border-box;
			padding:0 38rpx;
			.list-item-avatar {
				width: 80rpx;
				height: 80rpx;
				flex-shrink: 0;
				border-radius: 80rpx;
				margin-right: 24rpx;
			}
			.list-item-name {
				color: #3f3f44;
				 font-family: "PingFang SC";
				 font-size: 24rpx;
				 font-style: normal;
				 font-weight: 500;
			}
			.list-item-time {
				 color: #3f3f44;
				 text-align: right;
				 font-family: "PingFang SC";
				 font-size: 24rpx;
				 font-style: normal;
				 font-weight: 500;
				 margin-left: auto;
			}
		}
	}
	.btns {
		height: 108rpx;
		flex-shrink: 0;
		border-radius: 24rpx;
		background: #0065FF;
		width: 100%;
		display: flex;
		align-items: center;
		justify-content: center;
		 color: #ffffff;
		 text-align: center;
		 font-family: "PingFang SC";
		 font-size: 34rpx;
		 font-style: normal;
		 font-weight: 400;
	}
</style>